package com.example.springbootmybatisplusdatapermission.data;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface UserMapper extends BaseMapper<User> {
    // 根据用户名查询用户信息
    User findByUsername(@Param("username") String username);

    // 查询用户的角色信息
    List<String> findRolesByUsername(@Param("username") String username);

    // 查询用户的数据权限范围
    String findDataScopeByUsername(@Param("username") String username);
}
